home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / faq / comp / aix_faq / part2 < prev    next >
Internet Message Format  |  1994-03-30  |  64KB

  1. Path: bloom-beacon.mit.edu!hookup!news.moneng.mei.com!howland.reston.ans.net!cs.utexas.edu!uunet!ams.amsinc.com!162.70.244.20!jwarring
  2. From: jwarring@fmsaix.amsinc.com (Jeff Warrington)
  3. Newsgroups: comp.unix.aix,comp.answers,news.answers
  4. Subject: AIX Frequently Asked Questions (Part 2 of 3)
  5. Supersedes: <1491@mavrick.UUCP>
  6. Followup-To: comp.unix.aix
  7. Date: 31 Mar 1994 02:39:53 GMT
  8. Organization: American Management Systems, Inc.
  9. Lines: 1610
  10. Approved: news-answers-request@MIT.EDU
  11. Distribution: world
  12. Expires: 30 Apr 94 01:23:45 GMT
  13. Message-ID: <3001@flAIXy.fd.amsinc.com>
  14. Reply-To: jwarring@flAIXy.fd.amsinc.com
  15. NNTP-Posting-Host: flaixy.fd.amsinc.com
  16. Summary: This posting contains a list of Frequently Asked Questions 
  17.          and their answers about AIX, IBM's version of Unix.
  18. Keywords: AIX RS/6000 questions answers
  19. Xref: bloom-beacon.mit.edu comp.unix.aix:22836 comp.answers:4352 news.answers:17014
  20.  
  21. Archive-name: aix-faq/part2
  22. Last-modified: March 23, 1994
  23. Version: 3.00
  24.  
  25.  
  26. Version: $Id: aix.faq,v 3.00 94/3/23 jwarring $
  27.  
  28. Frequently Asked Questions to AIX 3.x and IBM RS/6000
  29. _____________________________________________________
  30.  
  31. 1.201: How do I do remote backup?
  32.  
  33. There seems to be several ways of doing this. I found the following works:
  34.  
  35.   tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"
  36.  
  37.  
  38. From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)
  39.  
  40. mksysb will not back up to remote tape devices. The following script
  41. will do remote backups.
  42.  
  43. [Ed.: I've verified this script works fine. However, it may be slow for
  44.  large filesystems since it creates a temp file of filenames in /tmp.]
  45.  
  46. #!/bin/ksh
  47. # @(#) Create a backup tape of the private user data.
  48. #=================================================================#
  49. #   Script :  usave.sh                                            #
  50. #   Author :  F. Kraemer                                          #
  51. #   Date   :  92/02/19                                            #
  52. #   Update :  92/10/29                                            #
  53. #   Info   :  the ultimative backup script                        #
  54. #   Example:  usave.sh /dev/rmt0      -  save to local tape       #
  55. #             usave.sh /save/save.me  -  save to local file       #
  56. #             usave.sh /tmp/pipe      -  save to remote tape      #
  57. #-----------------------------------------------------------------#
  58. PS4="(+) "
  59. #set -x
  60. PROG=$(basename $0)
  61. HOST=$(hostname)
  62. TODAY=$(date +%H:%M:%S)
  63. #
  64. # cleanup
  65. #
  66. cleanup ()
  67. {
  68. ec=$1
  69. error=$2
  70. case "$ec"
  71. in
  72.    "$USAGE_EC")    # usage error
  73.      error="Usage:\t$PROG DeviceName\n" 1>&2
  74.     ;;
  75.    "$NOTAP_EC")    # Tape error
  76.      error="error:\t$PROG: $DEVICE is not available on the system.\n" 1>&2
  77.     ;;
  78.    "$LISTE_EC")    # list error
  79.      error="error:\t$PROG: could not create tar list for $LOGNAME.\n" 1>&2
  80.     ;;
  81.    "$NOTAR_EC")    # tar command error
  82.      error="error:\t$PROG: tar command failed.\n" 1>&2
  83.     ;;
  84.    "$PIPEP_EC")    # pipe error
  85.      error="error:\t$PROG: mknod command failed.\n" 1>&2
  86.     ;;
  87.    "$NORSH_EC")    # rsh error
  88.      error="error:\t$PROG: rsh - Remote Shell command failed.\n" 1>&2
  89.     ;;
  90.    "$RHOST_EC")    # remote host error
  91.      error="error:\t$PROG: Remote Host unknown.\n" 1>&2
  92.     ;;
  93.    *)
  94.    ;;
  95. esac
  96. case "$DEVICE"
  97. in
  98.     #
  99.     # Fix the block size if $DEVICE is a tape device
  100.     #
  101.     /dev/rmt[0-9]*)
  102.         echo "\n\t$PROG: Rewinding tape to begin.........(please wait)\n"
  103.         tctl -f $DEVICE rewind 2>/dev/null
  104.         ;;
  105.     *) ;;
  106. esac
  107. rm -f ${LIST} ${PIPE} 2>/dev/null
  108. [ -n "$error" ] && echo "\n${error}\n"
  109. trap '' 0 1 2 15
  110. exit "$ec"
  111. }
  112. #
  113. # Variables
  114. #
  115. USAGE_EC=1                         # exit code for usage error
  116. NOMNT_EC=2                         # exit code wrong device name
  117. NOTAP_EC=3                         # exit code no tape available
  118. LISTE_EC=4                         # exit code backup list error
  119. NOTAR_EC=5                         # exit code for wrong tar
  120. TRAPP_EC=6                         # exit code for trap
  121. PIPEP_EC=7                         # exit code for pipe
  122. RHOST_EC=8                         # exit code for bad ping
  123. NORSH_EC=9                         # exit code for bad rsh
  124. DEVICE="$1"                        # device to tar into
  125. LIST="/tmp/.tar.$LOGNAME.$$"       #
  126. REMOTEH=""                         # Remote host for backup
  127. REMOTET=""                         # Remote tape for backup
  128. tapedev=                           #
  129. PIPE="/tmp/pipe"                   # Pipe for remote backup
  130. #
  131. # main()
  132. #
  133. tput clear
  134. echo "\n\t$PROG started from $LOGNAME@$HOST on $TERM at $TODAY.\n"
  135. rm -f $LIST 2>/dev/null
  136. #
  137. # Trap on exit/interrupt/break to clean up
  138. #
  139. trap "cleanup $TRAPP_EC \"Abnormal program termination. $PROG"\"  0 1 2 15
  140. #
  141. # Check command options
  142. #
  143. [ "$#" -ne 1 ]  &&  cleanup "$USAGE_EC" ""
  144. #
  145. # Check device name
  146. #
  147. [ `expr "$DEVICE" : "[/]"` -eq 0 ] && cleanup "$NOMNT_EC" \
  148.         "$PROG: Backup device or file name must start with a '/'."
  149. #
  150. # Check tape device
  151. #
  152. case "$DEVICE"
  153. in
  154.     #
  155.     # Fix the block size if $DEVICE is a tape device
  156.     #
  157.     /dev/rmt[0-9]*)
  158.         #
  159.         echo "\n\t$PROG: Verify backup media ($DEVICE)............\n"
  160.         #
  161.         # see if a low or high density tape device was specified
  162.         # (eg rmt0.1)
  163.         density="`expr $DEVICE : \
  164.                 "/dev/rmt[0-9]*\.\([0-9]*\)"`"
  165.         #
  166.         # strip /dev/ from device name and
  167.         # get the base name (eg translate:
  168.         # /dev/rmt0.2 to rmt0)
  169.         #
  170.         tapedev="`expr $DEVICE : \
  171.                 "/dev/\(rmt[0-9]*\)[\.]*[0-9]*"`"
  172.         #
  173.         # Check if the tape is defined in the system.
  174.         lsdev -C -c tape -S Available -F "name" | grep $tapedev >/dev/null 2>&1
  175.         rc=$?
  176.         [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
  177.         #
  178.         # Restore old tape name.
  179.         #
  180.         [ "${density:-1}" -lt 4 ] && density=1 || density=5
  181.         DEVICE="/dev/${tapedev}.${density}"
  182.         echo "\n\t$PROG: Insert a tape in ($DEVICE)........(press enter)\n"
  183.         read TEMP
  184.         echo "\n\t$PROG: Rewinding tape to begin...........(please wait)\n"
  185.         tctl -f $DEVICE rewind 2>/dev/null
  186.         ;;
  187.     #
  188.     # Backup is done on remote host. The remote shell facility
  189.     # must be set up and running.
  190.     #
  191.     ${PIPE}*)
  192.         #
  193.         echo "\n\t$PROG: Assuming remote backup via network.\n"
  194.         echo "\t$PROG: Enter name of Remote Host   ===> \c"
  195.         read REMOTEH
  196.         echo "\n\t$PROG: Pinging Remote Host to test connection.\n"
  197.         ping ${REMOTEH} 1 1 >/dev/null 2>&1
  198.         rc=$?                                    # give up unknown host
  199.         [ "$rc" -ne 0 ] && cleanup "$RHOST_EC" ""
  200.         JUNK=$(rsh ${REMOTEH} "/usr/sbin/lsdev -C -c tape -S Available")
  201.         rc=$?                                    # give up rsh failed
  202.         [ "$rc" -ne 0 ] && cleanup "$NORSH_EC" ""
  203.         echo "\t$PROG: Available Tapes on ${REMOTEH} are :\n\n\t\t${JUNK}\n"
  204.         echo "\t$PROG: Enter name of Remote Tape (e.g. /dev/rmt0) ===> \c"
  205.         read REMOTET
  206.         echo "\n\t$PROG: Insert tape on ${REMOTEH} in ${REMOTET}..(press enter)"
  207.         read TEMP
  208.         echo "\t$PROG: Rewinding Remote Tape ${REMOTET} on ${REMOTEH}.\n"
  209.         rsh ${REMOTEH} "tctl -f ${REMOTET} rewind"
  210.         rc=$?                                    # give up rsh failed
  211.         [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
  212.         rm -f ${PIPE} 2>/dev/null
  213.         mknod ${PIPE} p
  214.         rc=$?                                    # give up mknod failed
  215.         [ "$rc" -ne 0 ] && cleanup "$PIPEP_EC" ""
  216.         cat ${DEVICE} | rsh ${REMOTEH} "dd of=${REMOTET} obs=100b 2>/dev/null" &
  217.         ;;
  218.     *)  ;;
  219. esac
  220. #
  221. # Prepare the list
  222. #
  223. echo "\n\t$PROG: Create list of files to be saved...."
  224. find $HOME -print > $LIST
  225. rc=$?
  226. [ "$rc" -ne 0 ] &&  cleanup "$LISTE_EC" ""
  227. #
  228. # tar the files
  229. #
  230. echo "\n\t$PROG: Changing current directory to (/)...."
  231. cd / > /dev/null 2>&1
  232. echo "\n\t$PROG: Running tar format backup from user ($LOGNAME)...."
  233. tar -cvf "$DEVICE" -L "$LIST"
  234. rc="$?"
  235. [ "$rc" -ne 0 ]  && cleanup "$NOTAR_EC" ""
  236. #
  237. # Backup completed
  238. #
  239. TODAY=$(date +%H:%M:%S)
  240. echo "\n\t$PROG ended at $TODAY............................\n\n"
  241. cleanup 0
  242.  
  243.  
  244. 1.202: How do I backup a multi-disk volume group?
  245. From: pack@acd.ucar.edu (Daniel Packman)
  246.  
  247. [ Ed.: I have not verified this procedure. I would actually recommend
  248.   NOT to have one volume group span multiple disks unless you really
  249.   need such big logical volumes. ]
  250.  
  251.   1. If you have a set of three or more disks in a volume group
  252.      (typically 3 for 5xx machines with three internal drives;
  253.      with only two, the procedures outlined here have to be modified
  254.      to ignore the fact that you don't have a quorum in the volume group)
  255.  
  256.   2. If one drive has failed (usually only one fails at a time :-) )
  257.  
  258. It is possible to go through a service boot (the volume group is called
  259. rootvg and one of the 2 good disks on it is called hdisk0):
  260.  
  261.   importvg -y rootvg hdisk0
  262.   varyonvg -f -n -m1 rootvg
  263.  
  264. These commands will work, but give error messages. If you wish to mount
  265. a user filesystem, say /u on logical volume /dev/lv00, then
  266.  
  267.   mount -f /dev/lv00 /v
  268.  
  269. will work only if jfslog, the journaled file system log device, is not
  270. on the damaged disk. If it is, you must (and can in any case) mount the
  271. filesystem read-only:
  272.  
  273.   mount -f -r /dev/lv00 /v
  274.  
  275. This crucial and rather obvious point baffled several level 3 support
  276. personnel at Austin as well as myself for almost a week. Once the file
  277. system(s) of interest are available, they can be saved to tape for
  278. restoration later. Of course, one can expect only about two thirds of a
  279. filesystem to be recoverable if it spans all 3 physical disks. One
  280. other point to remember is that the standard boot procedure from floppy
  281. includes the restore command but does not include the backup command.
  282.  
  283. *****************************************************************************
  284. * If you do not have other RS6000 machines at your site it is imperative    * 
  285. * that you either build a bootable tape which includes either restore or    * 
  286. * tar or cpio (a bootable floppy set will not have enough space) or at the  *
  287. * very least copy onto a spare floppy backup, cpio, or tar.  The floppy     *
  288. * should be created with backup -ivq so that its contents can be read into  *
  289. * the memory resident system after booting.                                 *
  290. *****************************************************************************
  291.  
  292. All is not lost if tar, cpio or backup are available on an undamaged
  293. disk that can be mounted. Since tar and cpio are in /bin, they may both
  294. very well be unavailable.
  295.  
  296. It is a very good idea for those who have tape devices to build a
  297. bootable tape with their desired extra commands in it. Follow the
  298. instructions from IBM but add your desired commands to the following
  299. three files:
  300.  
  301.     /usr/lpp/bosinst/tape2
  302.     /usr/lpp/bosinst/diskette/boot2
  303.     /usr/lpp/bosinst/diskette/inslist
  304.  
  305. If you have anything other than a minimum memory configuration, you
  306. should be able to add many commands.
  307.  
  308.  
  309. 1.203: How do I put multiple backups on a single 8mm tape?
  310. From: kerm@mcnc.org (Cary E. Burnette)
  311.  
  312. There are two possible solutions to this, both of which use /dev/rmt0.1
  313. which is non-rewinding.
  314.  
  315. SOLUTION #1
  316. -----------
  317.  
  318. To put multiple backups on a single tape, use /dev/rmt0.1, which is a
  319. no-rewind device, using either rdump or backup (both by name & inode
  320. work). Using rdump or backup "byinode" both generate the message that
  321. the tape is rewinding but actually do not. This is an example that
  322. works on my system:
  323.  
  324. # rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  325. # rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  326. # tctl -f /dev/rmt0.1 rewind       # rewinds the tape
  327.  
  328. where I am implementing the command from host.
  329. To restore a table of contents of the first I would use 
  330.  
  331. # restore -f /dev/rmt0.1 -s1 -tv
  332.  
  333. where the -s1 flag tells restore to go to the first record on the tape. 
  334. Type the exact command again to get the second record. The -s(Number)
  335. means go to Number record from this spot. It works pretty well.
  336.  
  337.  
  338. SOLUTION #2
  339. -----------
  340.  
  341. Steve Knodle
  342. Educational Resources Center
  343. Clarkson University
  344.  
  345. I use:
  346. ------------------- Dump.sh --------------------
  347. CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
  348. set -x
  349. LEVEL=$1
  350. shift
  351.  
  352. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
  353. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
  354. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
  355. tctl -f /dev/rmt0 rewind
  356.  
  357. touch /usr/local/dumps/Contents.$CONTENTSFILE
  358. echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
  359. restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  360. echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
  361. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  362. echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
  363. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  364. tctl -f /dev/rmt0 rewind
  365.  
  366. I process the table-of-contents first by a little program that does
  367. common prefix encoding, and then compress.
  368.  
  369. This gives a table of contents file I can keep on-line until the tape
  370. is reused.
  371.  
  372.  
  373. 1.204: How can I make an exact duplicate of a tape over the network?
  374.  
  375. The challenge here is not to have to create a temporary file (disk space
  376. limitation) and work across heterogeneous networks.
  377.  
  378. This script might work:
  379.  
  380. LOCAL=/dev/tape_dev
  381. REMOTE=/dev/tape_dev
  382. dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE
  383.  
  384.  
  385. From: pack@acd.ucar.edu (Daniel Packman)
  386.  
  387. Daniel provides the following perl script to convert from the known
  388. world's function codes to AIX for compatibility.
  389.  
  390. #!/bin/perl
  391. # Wrapper to convert input rmt requests to
  392. # AIX 3.2 ioctl numbers.  We pass on all commands we don't understand
  393. # I0 MTWEOF -> I10  STWEOF write and end-of-file record
  394. # I1 MTFSF  -> I11  STFSF  forward space file
  395. # I2 MTBSF  -> I12  STRSF  reverse space file
  396. # I3 MTFSR  -> I13  STFSR  forward space record
  397. # I4 MTBSR  -> I14  STRSR  reverse space record
  398. # I5 MTREW  -> I6   STREW  rewind
  399. # I6 MTOFFL -> I5   STOFFL rewind and unload tape
  400. # I7 MTNOP  -> I0   (no-op? should ignore following count)
  401. # I8 MTRETEN-> I8   STRETEN retension tape, leave at load point
  402. # I9 MTERASE-> I7   STERASE erase tape, leave at load point
  403. #I10 MTEOM (position to end of media ... no ibm equivalent?)
  404. #I11 MTNBSF  (backward space file to BOF ... no ibm equivalent?)
  405. @iocs = (10,11,12,13,14,6,5,0,8,7);
  406. open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
  407. select(RMT);
  408. $| = 1;
  409. while (<STDIN>) {
  410.   s/(^I)(\d$)/I$iocs[$2]/;
  411.   exit 0 if $_ =~ /^[Qq]/;
  412.   print RMT $_ ; }
  413. exit 0;
  414.  
  415.  
  416. 1.205: What is tape block size of 0?
  417. From: benson@odi.com (Benson I. Margulies)
  418.  
  419. Tape devices are generally split into two categories: fixed block and
  420. variable block.  1/4" tape is the fixed block, and 8mm is variable.
  421.  
  422. On a fixed block size device, the kernel always sends data to the device
  423. in suitable block size lumps, and varying the size passed to write(2)
  424. (e.g., via the bs option to dd) gives the kernel more data to stream. 
  425. On a variable block size device, the kernel writes to the device
  426. whatever passed to it. On an 8mm, it had better be a multiple of 1024
  427. to get efficient tape usage.
  428.  
  429. AIX has the World's Only Variable Block Size 1/4" tape drive. If you
  430. use SMIT to set the block size to a nonzero value, AIX treats the device
  431. as fixed block size, whether it is or not. By default, 8mm drives are
  432. set to the same size as 1/4", 512 bytes. This is wasteful, but
  433. otherwise mksysb and installp would fail.
  434.  
  435. If you set the block size to 0, the device is treated as variable block
  436. size, and the size passed to write becomes the physical block size. 
  437. Then if you use a sensible block size to dd, all should be wonderful.
  438.  
  439.  
  440. 1.206: Resetting a hung tape drive
  441. From: Craig_Anderson@kcbbs.gen.nz (Craig Anderson)
  442.  
  443. A process accesses the tape drive. The process stops, exits, or whatever,
  444. but still hold on to the drive. When this happens, the process cannot be
  445. killed by any signal and the tape drive cannot be used by any other
  446. process until the machine is rebooted.
  447.  
  448. The following should help:
  449.  
  450. RESET:
  451.  
  452. AIX, like most UNIX systems has no reset function for tape drives. You
  453. can however send a Bus Device Reset (a standard SCSI message) to the
  454. tape drive using the following piece of code. If the tape drive does
  455. not respond to the BDR, then a SCSI Bus Reset will be sent (and this
  456. will reset every device on the SCSI Bus). SCSI Bus resets are rather
  457. extreme so you should refrain from using this program unnecessarily. 
  458. But there are times (like after you've inserted a jammed/old/bad tape in
  459. an 8mm drive), when there's no other way to reset the device other than
  460. to shutdown and reboot (obviously you can power down and up an external
  461. drive to reset it - and this would be the better choice).
  462.  
  463. This is actually documented in info, but can be hard to find and
  464. there's no complete program.
  465.  
  466. /* taperst: resets the tape drive by sending a BDR to the drive. */
  467. #include <stdio.h>
  468. #include <fcntl.h>
  469. #include <errno.h>
  470. #include <sys/scsi.h>
  471.  
  472. int main(int argc, char **argv)
  473. {
  474.          /* This can be run only by root */
  475.  
  476.          if (argc != 2) {
  477.              fprintf(stderr, "Usage: %s /dev/rmt#\n", argv[0]);
  478.              return 1;
  479.          }
  480.  
  481.          if (openx(argv[1], O_RDONLY, 0, SC_FORCED_OPEN) < 0) {
  482.              perror(argv[0]);
  483.              return 2;
  484.          }
  485.          return 0;
  486. }
  487.  
  488. 1.207: How do I read a mksysb tape with tar?
  489. From: Marc Pawliger (marc@sti.com)
  490.  
  491. To recover specific files from a backup made with mksysb, try
  492. $ tctl fsf 3
  493. $ tar xvf/dev/rmt0.1 ./your/file/name
  494.  
  495. ______________________________________________________________________________
  496. 1.300: Some info about the memory management system
  497. From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).
  498.  
  499. 1. Does AIX use more paging space than other unix systems?
  500.  
  501. Under many scenarios, AIX requires more paging space than other unix
  502. systems. The AIX VMM implements a technique called "early allocation of
  503. paging space". When a page is allocated in RAM, and it is not a
  504. "client" (NFS) or a "persistent" (disk file) storage page, then it is
  505. considered a "working" storage page. Working storage pages are commonly
  506. an application's stack, data, and any shared memory segments. So, when
  507. a program's stack or data area is increased, and RAM is accessed, the
  508. VMM will allocate space in RAM and space on the paging device. This
  509. means that even before RAM is exhausted, paging space is used. This
  510. does not happen on many other unix systems, although they do keep track
  511. of total VM used.
  512.  
  513. Example 1: 
  514. Workstation with 64mb RAM is running only one small application that
  515. accesses a few small files. Everything fits into RAM, including all
  516. accessed data. On AIX, some paging space will already be used. On
  517. other unix systems, paging space will be 100% free. Clearly, this is an
  518. example that shows where we use more paging space than the other machines.
  519.  
  520. Example 2:
  521.  
  522. Same machine as above, except we are in an environment where many
  523. applications are running with inadequate RAM. Also, the system is
  524. running applications that are started, run, left idle, and not in
  525. constant use. A session of FRAME running in a window, for example. 
  526. What happens is that eventually (theoretically) all applications will be
  527. paged out at least once. On the AIX system and the other systems the
  528. total paging requirements will be the same (assuming similar malloc
  529. algorithm). The major difference is that the AIX system allocated the
  530. paging space pages before they were actually needed, and the other
  531. systems did not allocate them until they were needed. However, most
  532. other systems have an internal variable that gets incremented as virtual
  533. memory pages are used. AIX does not do this. This can cause the AIX
  534. system to run out of paging space (virtual memory), even though malloc()
  535. continues to return memory. This "feature" allows sparse memory
  536. segments to work, but requires that all normal users of malloc()
  537. (sbrk()) know how much virtual memory will be available (actually
  538. impossible), and to handle a paging space low condition. A big problem. 
  539. There are some pretty obvious pros and cons to both methods of doing
  540. Virtual Memory.
  541.  
  542. 2. How much paging space do I need?
  543.  
  544. Concerning the rule of thumb of having 2 times RAM for paging space:
  545. this is rather simplistic, as are most rules of thumb.  If the machine
  546. is in a "persistent storage environment", meaning that they have a few
  547. small programs, and lots of data, they may not need even as much as 1
  548. times RAM for paging space.  For example, a 1GB database server running
  549. on a 6000 with 256MB of RAM, and only running about 50MB of "working"
  550. storage does not need 512MB of paging space, or even 256MB.  They only
  551. need the amount of paging space that will allow all their working
  552. storage to be paged out to disk.  This is because the 1GB database is
  553. mostly "persistent storage", and will require little or no paging space. 
  554. Excessive paging space may simply mean wasted disk space.  However,
  555. avoid insufficient paging space.  Tip: Don't have more than one paging
  556. space per disk.  Tip: Put lots of RAM in your system - it will use it.
  557.  
  558. 3. Why does vmstat show no free RAM pages?
  559.  
  560. AIX uses RAM as a possibly huge disk buffer.  If you read a file in the
  561. morning, that file is read into RAM, and left there.  If no other
  562. programs need that RAM, that file will be left in RAM until the machine
  563. is halted.  This means that if you need the file again, access will be
  564. quick.  If you need that RAM, the system will simply use the pages the
  565. file were using. The pages were flushed back to disk earlier.  This
  566. means that you can get a huge speedup in disk access if you have enough
  567. RAM.  For example, a 200MB database will just ease into RAM if you have
  568. a 256MB system.
  569.  
  570. 4. Since vmstat shows no free RAM pages, am I out of RAM?
  571.  
  572. Probably not. Since disk files will be "mapped" into RAM, if vmstat
  573. shows lots of RAM pages FREE, then you probably have too much RAM (not
  574. usual on a RISC System/6000)!
  575.  
  576. 5. Shouldn't the "avm" and the "fre" fields from vmstat add up to something?
  577.  
  578. No. The "avm" field tells you how much "Active Virtual Memory" AIX
  579. thinks you are using. This will closely match the amount of paging
  580. space you are using. This number has *ABSOLUTELY* nothing to do with
  581. the amount of RAM you are using, and does *NOT* include your mapped
  582. files (disk files).
  583.  
  584. 6. Why does the "fre" field from vmstat sometimes show lots of free
  585.    RAM pages?
  586.  
  587. This will happen after an application that used a lot of RAM via
  588. "working" storage (not NFS storage, and not disk file or "persistent"
  589. storage) exits. When RAM pages that were used by working storage (a
  590. program's stack and data area) are no longer needed, there is no need to
  591. leave them around. AIX completely frees these RAM pages. The time to
  592. access these pages versus a RAM page holding a "sync'd" mapped file is
  593. almost identical. Therefore, there is no need to periodically "flush" RAM.
  594.  
  595. 7. Is the vmstat "fre" field useful?
  596.  
  597. The vmstat "fre" field represents the number of free page frames.  If
  598. the number is consistently small (less than 500 pages), this is normal. 
  599. If the number is consistently large (greater than 4000 pages), then you
  600. have more memory than you need in this machine.
  601.  
  602.  
  603. 1.301: How much should I trust the ps memory reports?
  604. From: chukran@austin.VNET.IBM.COM
  605.  
  606. Using "ps vg" gives a per process tally of memory usage for each running
  607. process.  Several fields give memory usage in different units, but these
  608. numbers do not tell the whole story on where all the memory goes.
  609.  
  610. First of all, the man page for ps does not give an accurate description
  611. of the memory related fields.  Here is a better description:
  612.  
  613. RSS - This tells how much RAM resident memory is currently being used
  614. for the text and data segments for a particular process in units of
  615. kilobytes.  (this value will always be a multiple of 4 since memory is
  616. allocated in 4 KB pages).
  617.  
  618. %MEM - This is the fraction of RSS divided by the total size of RAM for
  619. a particular process.  Since RSS is some subset of the total resident
  620. memory usage for a process, the %MEM value will also be lower than actual.
  621.  
  622. TRS - This tells how much RAM resident memory is currently being used
  623. for the text segment for a particular process in units of kilobytes. 
  624. This will always be less than or equal to RSS.
  625.  
  626. SIZE - This tells how much paging space is allocated for this process
  627. for the text and data segments in units of kilobytes.  If the executable
  628. file is on a local filesystem, the page space usage for text is zero. 
  629. If the executable is on an NFS filesystem, the page space usage will be
  630. nonzero.  This number may be greater than RSS, or it may not, depending
  631. on how much of the process is paged in.  The reason RSS can be larger is
  632. that RSS counts text whereas SIZE does not.
  633.  
  634. TSIZ - This field is absolutely bogus because it is not a multiple of 4
  635. and does not correlate to any of the other fields.
  636.  
  637. These fields only report on a process text and data segments.  Segment
  638. size which cannot be interrogated at this time are:
  639.  
  640.        Text portion of shared libraries (segment 13)
  641.  
  642.        Files that are in use. Open files are cached in memory as
  643.        individual segments.  The traditional kernel cache buffer
  644.        scheme is not used in AIX 3.
  645.  
  646.        Shared data segments created with shmat.
  647.  
  648.        Kernel segments such as kernel segment 0, kernel extension
  649.        segments, and virtual memory management segments.
  650.  
  651. Speaking of kernel segments, the %MEM and RSS report for process zero
  652. are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
  653. kernel segment zero is counted twice.  For AIX 3.2, this has been
  654. changed, but the whole story is still not known.  The RSS value for
  655. process 0 will report a very small number of the swapper private data
  656. segment.  It does not report the size of the kernel segment 0, where the
  657. swapper code lives.
  658.  
  659. In summary, ps is not a very good tool to measure system memory usage. 
  660. It can give you some idea where some of the memory goes, but it leaves
  661. too many questions unanswered about the total usage.
  662.  
  663. ______________________________________________________________________________
  664. 1.400: How do I make an informative prompt in the shell?
  665.  
  666. In the Korn Shell (ksh), the PS1 variable is expanded each time it is
  667. printed, so you can use:
  668.  
  669. $ myhost=`hostname`
  670. $ PS1='$LOGNAME@$myhost $PWD \$ '
  671.  
  672. to get, e.g. 
  673.  
  674. bengsig@ieibm1 /u/bengsig $
  675.  
  676. In the C-shell, use:
  677.  
  678. % set myhost=`hostname`
  679. % alias cd 'chdir \!* > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
  680. % cd
  681.  
  682. to get, e.g.
  683.  
  684. bengsig@dkunix9 /u/bengsig/aixfaq %
  685.  
  686. There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.
  687.  
  688.  
  689. 1.401: How do I set up ksh for emacs mode command line editing?
  690. From: scotte@cdsac.uucp (L. Scott Emmons)
  691.  
  692. The ksh has an undocumented way of binding the arrowkeys to the emacs
  693. line editing commands. In your .kshrc, add:
  694.  
  695. alias __A=^P
  696. alias __B=^N
  697. alias __C=^F
  698. alias __D=^B
  699. alias __H=^A
  700.  
  701. Note that "^P" (et al) must be the actual control sequence.
  702.  
  703. Type "set -o emacs" or put this line in your .profile.
  704.  
  705. Also, you MUST have PTF U406855 for this to work in AIX 3.2.  The APAR #
  706. for the problem is IX25982, which may have been superseded.
  707.  
  708.  
  709. 1.402: Listing files with ls causes a core dump
  710. From: John F Haugh II
  711.  
  712. Scenario: a directory that is shared by N users (N >= 200).
  713. Run 'ls -l' in that directory.  It goes for a while, then
  714. Seg fault(coredump)!
  715.  
  716. It only occurs when the usernames are displayed (almost every file is
  717. owned by a different person).  The -g and -n options work fine; only -l
  718. and -o (which shows owner and not group) cause it. 
  719.  
  720. I believe that this problem was corrected by U407548.  If you have that
  721. many users that you are having core dump problems (it took over 200),
  722. you might also want to look into getting the PTF that fixes IX31403. 
  723. That APAR deals with large numbers of accounts and performance problems
  724. associated with looking them up.
  725.  
  726.  
  727. 1.403: How do I put my own text into InfoExplorer?
  728.  
  729. With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
  730. InfoCrafter that allows you to do that.
  731.  
  732.  
  733. 1.404: InfoExplorer ASCII key bindings 
  734. From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)
  735.  
  736. If you just press 'Return' when it starts up, with 'Basic Screen
  737. Operations' highlighted, you'll get some help.
  738.  
  739. If you look long enough, you'll find a page named 'Using Keys and Key
  740. Sequences in the InfoExplorer ASCII Interface'.  It describes the key
  741. sequences and actions.  Here are a few to get you started.
  742.  
  743. Keys       Action
  744.  
  745. Ctrl-W     Moves between the Navigation screen and the Reading screen.
  746. If the Navigation screen is displayed, you can press Ctrl-W to display
  747. the Reading screen.  If the Reading screen is displayed, you can press
  748. Ctrl-W to display the Navigation screen.
  749.  
  750. Ctrl-O     Makes the menu bar active or inactive.  If your text cursor is
  751. located in the text area of the screen, you can press Ctrl-O to make the
  752. menu bar active.  If the menu bar is already active, you can press
  753. Ctrl-O to make it inactive, which moves the text cursor to the text area.
  754.  
  755. Tab     Moves to the next menu bar option in the menu bar.  If a pull-down
  756. menu is not displayed and you press the Right Arrow key, the next menu
  757. bar option is displayed in reverse video.
  758.  
  759.  
  760. 1.405: How can I add new man pages to the system?
  761. From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)
  762.  
  763. Put the man pages in /usr/man, e.g. /usr/man/man1/tcsh.1 for the tcsh
  764. man page.  Unter AIX 3.1.10, /usr/lib/makewhatis can be used to update
  765. the makewhatis-database /usr/man/whatis so apropos and whatis know about
  766. the added manpages.  /usr/lib/makewhatis should be available on all 3.2
  767. versions.
  768.  
  769. ______________________________________________________________________________
  770. 1.500  Which release of X11 do I have?
  771.  
  772. Run 'lslpp -h X11rte.obj'.
  773. If your output has a line similar to:
  774.  
  775.             01.02.0000.0000 COMPLETE   COMMIT     03/04/93   02:05:11 root
  776.  
  777. you have X11 R4. If your output has a line similar to:
  778.  
  779.     U491068 01.02.0003.0000 COMPLETE   COMMIT     07/28/93   12:50:42 root
  780.  
  781. you have X11 R5. Some people also call these AIXwindows 1.2.0 and 1.2.3.
  782.  
  783.  
  784. 1.501: How to prevent ctrl-alt-backspace from killing the X session
  785.  
  786. Start X with 'xinit -T' to disable ctrl-alt-backspace from stopping X.
  787.  
  788.  
  789. 1.502: Who has a termcap/terminfo source for the HFT console?
  790.  
  791. The console used on the RISC System/6000, PS/2 and RT can be used as a
  792. terminal on another system with the termcap below.  You can find this
  793. and other termcaps in /lib/libtermcap/termcap.src, including IBM
  794. specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
  795. This termcap can also be used from an aixterm window.
  796.  
  797. hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
  798.     :co#80:li#25:am:ht:\
  799.     :cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
  800.     :nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
  801.     :bs:sf=\E[S:ec=\E[%dX:\
  802.     :cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
  803.     :AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
  804.     :im=\E[4h:ei=\E[4l:mi:\
  805.     :dm=\E[4h:ed=\E[4l:\
  806.     :so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
  807.     :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
  808.     :as=^N:ae=^O:sc=\E[s:rc=\E[u:\
  809.     :kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
  810.     :kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
  811.     :k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
  812.     :is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:
  813.  
  814.  
  815. 1.503: How can I look at PostScript files?  Why is "dpsexec" so lousy?
  816. From Marc Pawliger (marc@sti.com)
  817.  
  818. showps comes with the 1.2.3 (X11R5) version of the X11rte.ext.obj LPP.
  819. Very nice PS file previewer from Adobe.  Replaces xpsview which came
  820. with pre-1.2.3 Installed as /usr/lpp/DPS/showps/showps
  821.  
  822. From: VRBASS@ATLVMIC1 (Vance R. Bass)
  823.  
  824. You can look at PostScript files using either "xpreview" (in the
  825. optionally installable text formatting services) or you can get
  826. Ghostscript and Ghostview from a comp.sources.x server and build it
  827. yourself.
  828.  
  829. >From the "xpreview" man page:
  830. The xpreview command is an AIXwindows 1.2- and Motif 1.1-based
  831. application that displays output from the troff command on an AIXwindows
  832. display.  The troff command output file must be prepared for any one of
  833. the devX100, devX100K or devpsc devices.  The xpreview command also
  834. displays PostScript language files that begin with %!.
  835.  
  836. "dpsexec" is NOT intended to be a full-service document browser, but
  837. rather a simple DPS code debugger.  If you insist on using it, you can
  838. edit your PS code to remove the "showpage" (which will reset dpsexec
  839. and clear the window) to view single-page files.  It does not handle
  840. multi-page files gracefully.
  841.  
  842.  
  843. 1.504: unix:0 vs `hostname`:0
  844.  
  845. 1.) Is there any way to get the machine to check its local host table
  846.     first without renaming resolv.conf?
  847.  
  848. From: mcguire@selway.umt.edu (Charles J McGuire)
  849.  
  850.   Not that I know of.  Under SunOS and Ultrix you can specify, check
  851.   /etc/hosts, then NIS, then DNS.  On our AIX machines, I have a cron job
  852.   that checks the integrity of both the primary and secondary
  853.   nameservers every 5 minutes.  If they're gone, cron renames
  854.   resolv.conf.  It continues to check the servers.  When they're back,
  855.   it moves resolv.conf back.  Even with this arrangement, I need to
  856.   configure two resolv.conf files that switch the order of the primary
  857.   and secondary servers if the primary goes away.  If the primary is
  858.   unavailable, queries can still take a while to time out on the
  859.   primary, before querying the secondary.  This method is not very
  860.   elegant, but it does the job.  Things are a little unstable during the
  861.   transitions depending on when the servers go away relative to when
  862.   cron runs - not to mention slight differences in clock times.
  863.  
  864. 2.) How do you tell X applications where you are if the console display 
  865.     is unix:0?
  866.  
  867. From: crow@waterloo.austin.ibm.com (David L. Crow)
  868.  
  869.   I would suggest that if you have R5, use ":<display>.<screen>".  I do
  870.   not believe that R4 clients will understand :0, so I would suggest
  871.   unix:0 for them.
  872.  
  873.   Without specifying unix or the hostname, you will get the fastest
  874.   transport mechanism.  While currently there are only two transport
  875.   methods in the AIXwindows X server (Unix sockets and TCP sockets),
  876.   many vendors are looking at using shared memory as a transport method. 
  877.   If you use :0 (or :0.0 or :1, etc.), then you should get the best
  878.   performance regardless of the available transport methods.
  879.  
  880. From Marc Pawliger (marc@sti.com)
  881.   Using "unix:0" or "hostname:0" when the X11 Shared Memory Transport
  882. (SMT) is installed as part of the 1.2.3 X11rte.obj (X11R5) will incur
  883. a penalty vs. using ":0" See /usr/lpp/X11/README.SMT
  884.  
  885. 3.) Is there a significant performance penalty incurred by using
  886.     `hostname`:0 as DISPLAY?
  887.  
  888.   Yes! Using unix:0, you are using Unix sockets.  These are much faster
  889.   than their TCP socket counterparts.
  890.  
  891.  
  892. 1.505: VT100 key bindings for aixterm
  893. From: haedener@iac.unibe.ch (Konrad Haedener)
  894.  
  895. Add this to your .Xdefaults file and start your VAX session with
  896. 'aixterm -v -name vt100 -e telnet MYVAXHOST'
  897.  
  898. -----
  899. vt100.foreground: Wheat
  900. vt100.background: MidnightBlue
  901. vt100.font: Rom14.500
  902. vt100.geometry: 80x25+0+0
  903. vt100.vt102: true
  904. vt100.fullcursor: false
  905. vt100.pointerColor: coral
  906. vt100.cursorColor: gray100
  907. vt100.translations:    <Key>F1: string(0x1b) string("OP") \n\
  908.                        <Key>F2: string(0x1b) string("OQ") \n\
  909.                        <Key>F3: string(0x1b) string("OR") \n\
  910.                        <Key>F4: string(0x1b) string("OS") \n\
  911.                        <Key>KP_0: string(0x1b) string("Op") \n\
  912.                        <Key>KP_1: string(0x1b) string("Oq") \n\
  913.                        <Key>KP_2: string(0x1b) string("Or") \n\
  914.                        <Key>KP_3: string(0x1b) string("Os") \n\
  915.                        <Key>KP_4: string(0x1b) string("Ot") \n\
  916.                        <Key>KP_5: string(0x1b) string("Ou") \n\
  917.                        <Key>KP_6: string(0x1b) string("Ov") \n\
  918.                        <Key>KP_7: string(0x1b) string("Ow") \n\
  919.                        <Key>KP_8: string(0x1b) string("Ox") \n\
  920.                        <Key>KP_9: string(0x1b) string("Oy") \n\
  921.                        <Key>KP_Divide: string(0x1b) string("OQ") \n\
  922.                        <Key>KP_Multiply: string(0x1b) string("OR") \n\
  923.                        <Key>KP_Subtract: string(0x1b) string("OS") \n\
  924.                        <Key>KP_Add: string(0x1b) string("Om") \n\
  925.                        <Key>KP_Enter: string(0x1b) string("OM") \n\
  926.                        <Key>KP_Decimal: string(0x1b) string("On") \n\
  927.                        <Key>Next: string(0x1b) string("Ol") \n\
  928.                        <Key>Left: string(0x1b) string("OD") \n\
  929.                        <Key>Up: string(0x1b) string("OA") \n\
  930.                        <Key>Right: string(0x1b) string("OC") \n\
  931.                        <Key>BackSpace : string(0x7f) \n\
  932.                        <Key>Down: string(0x1b) string("OB")
  933.  
  934. You should also add
  935.  
  936. XENVIRONMENT=$HOME/.Xdefaults
  937. export XENVIRONMENT
  938.  
  939. to your .profile.
  940.  
  941.  
  942. 1.506: Is there a screen saver that does not use excessive CPU?
  943.  
  944. From: buchholz@ese.ogi.edu (Don Buchholz)
  945.  
  946. Try using xlock with these options:
  947.  
  948.     xlock -mode life -count 1500 -nice 20 -root
  949.  
  950.  
  951. From: pranav@evolving.com (Pranav Vakil)
  952.  
  953. Use mlock -hide to hide the background. You can also modify the mlock
  954. (/usr/local/tools/mlock) code to allow the standard X screen saver to
  955. take effect. The timeout value is originally set to 0 which means the
  956. screen saver is off. Modify this to be 120 (2 minutes) and set the
  957. interval time to be 60 (1 minute). Using these intervals, I have found
  958. that over a 24 hour period, it uses only .3 cpu minutes.
  959.  
  960. ______________________________________________________________________________
  961. 1.600: My named dies frequently, why?
  962.  
  963. Running on 3.2, named dies frequently on network's primary name server.
  964.  
  965. From: jpe@ee.egr.duke.edu (John P. Eisenmenger)
  966.  
  967. Try the following:
  968.  
  969.      stopsrc -s named        # stop running named
  970.      setenv MALLOCTYPE 3.1    # use 3.1 memory allocation algorithm
  971.      /etc/named ...        # don't use smit to start named
  972.  
  973. You might be able to use startsrc/smit after setting MALLOCTYPE and get
  974. the same effect, but I'm not sure.
  975.  
  976. [According to John, the problem is malloc() in the named code. He
  977.  also suggests using Berkeley's bind, which he has ported and can be
  978.  ftp'ed from ftp.egr.duke.edu, /archives/network/bind-4.8.3.tar.Z. -ed]
  979.  
  980. Two ptfs should fix this problem. Get U412332 and U414752.
  981.  
  982. Christophe Wolfhugel <Christophe.Wolfhugel@grasp.insa-lyon.fr> reports
  983. that bind 4.9 works fine on AIX 3.2 and without MALLOCTYPE=3.1.
  984.  
  985.  
  986. 1.601: How do I trace ethernet packets on an AIX system?
  987. From: afx@muc.ibm.de (Andreas Siegert)
  988.  
  989. Do the following:
  990.  
  991.      iptrace -i en0 /tmp/ipt
  992.  
  993. The iptrace backgrounds.  Find its process id and kill it when you are
  994. ready.  Then run
  995.  
  996.      ipreport -rns /tmp/ipt >/tmp/ipr
  997.  
  998. and look at the output.  The current version of Info does not document
  999. the r, n and s options but they are quite useful for layering the output.
  1000.  
  1001.  
  1002. 1.602 What is the authorized way of starting automount at boot time?
  1003. From: curt@ekhadafi.austin.ibm.com (Curt Finch)
  1004.  
  1005. I put this in my /etc/inittab:
  1006.  
  1007. automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1
  1008.  
  1009. I hereby dub it authorized.
  1010.  
  1011.  
  1012. 1.603: How do I set a tty port for both dial-in and dial-out?
  1013.  
  1014. Set the mode of the tty to be either 'shared' or 'delayed'. 
  1015.  
  1016.  
  1017. 1.604: How to move or copy whole directory trees across a network
  1018.  
  1019. The following command will move an entire directory tree across a network 
  1020. while preserving permissions, uids and gids.
  1021.  
  1022.       $rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -
  1023.  
  1024. Explanation:
  1025.  
  1026. The tar-create is rsh'd to the remote system and is written to
  1027. stdout (the pipe).
  1028.  
  1029. The local system is extracting the tar that is being read from
  1030. stdin (the pipe).
  1031.  
  1032.  
  1033. 1.605: How can I send mail to hosts that cannot be pinged?
  1034. From: jupiter.sun.csd.unb.ca!dedourek (John DeDourek)
  1035.  
  1036. AIX 3.2 as shipped is configured to only send mail to mail addresses
  1037. which include a host name.  Many organizations use a mail address whose
  1038. "host name" part is not a host name (technically an MX name).  To change
  1039. the configuration of the AIX mailer, login as root.  Then edit the file
  1040. /etc/sendmail.cf to remove the comment marker ("# ") at the beginning of
  1041. the line which reads:
  1042.     # OK MX
  1043.  
  1044. Now rebuild the machine readable form of the configuration with
  1045.     sendmail -bz
  1046.  
  1047. and finally restart signal sendmail to load the new configuration by one
  1048. of the following:
  1049.      reboot
  1050. or
  1051.      stopsrc -s sendmail
  1052.      startsrc -s sendmail
  1053. or 
  1054.      kill -1 `cat /etc/sendmail.pid`
  1055.  
  1056.  
  1057. 1.606: How to configure dialup SLIP
  1058. From: marvin@tornado.oche.de (Christian Bode)
  1059.  
  1060. If you don't have problems with slattach you should have PTF 
  1061. bos.obj 3.2.0.0.U411505 installed.  I assume that you did the right
  1062. ifconfig commands to setup your slip-device (for example sl0).
  1063.  
  1064. 1. Create a group called slip.
  1065.  
  1066. 2. Create a user slip with smit like this:
  1067.                                                      [Entry Fields]
  1068. * User NAME                                          [slip]
  1069.   ADMINISTRATIVE User?                                true
  1070.   User ID                                            []
  1071.   LOGIN user?                                         true
  1072.   PRIMARY group                                      [slip]
  1073.   Group SET                                          [slip]
  1074.   ADMINISTRATIVE groups                              [system]
  1075.   SU groups                                          [slip]
  1076.   HOME directory                                     [/home/slip]
  1077.   Initial PROGRAM                                    [/bin/sh]
  1078.   User INFORMATION                                   [SLIP-Dialup]
  1079.   Another user can SU to user?                        false
  1080.   User can RLOGIN?                                    true
  1081.   TRUSTED PATH?                                       nosak
  1082.   Valid TTYs                                         [/dev/tty1]
  1083.   AUDIT classes                                      []
  1084.   PRIMARY authentication method                      [SYSTEM]
  1085.   SECONDARY authentication method                    [NONE]
  1086.   Max FILE size                                      [2097151]
  1087.   Max CPU time                                       [-1]
  1088.   Max DATA segment                                   [262144]
  1089.   Max STACK size                                     [65536]
  1090.   Max CORE file size                                 [2048]
  1091.   Max physical MEMORY                                [65536]
  1092.   File creation UMASK                                [022]
  1093.   EXPIRATION date (MMDDhhmmyy)                       [0]
  1094.  
  1095. 3. Create a tty with getty on it:
  1096.                                    Add a TTY
  1097.                                                [Entry Fields]
  1098.   TTY type                                     tty
  1099.   TTY interface                                rs232
  1100.   Description                                  Asynchronous Terminal
  1101.   Parent adapter                               sa0
  1102. * PORT number                                  [s1]
  1103.   BAUD rate                                    [38400]
  1104.   PARITY                                       [none]
  1105.   BITS per character                           [8]
  1106.   Number of STOP BITS                          [1]
  1107.   TERMINAL type                                [dumb]
  1108.   STATE to be configured at boot time          [available]
  1109.   DMA                                          on
  1110.   Read Trigger                                 0,1,2,3
  1111.   Transmit buffer count                        [16]
  1112.   Name of initial program to run               [/etc/getty]
  1113.  
  1114.   Note: The following attributes are only applicable if /etc/getty is
  1115.         specified as the initial program to run.
  1116.  
  1117.   Enable program?                              respawn
  1118.   Run level                                    2
  1119.   Enable LOGIN                                 share
  1120.   TIME before advancing to next port setting   [0]
  1121.   STTY attributes for RUN TIME                 [hupcl,cread,brkint>
  1122.   STTY attributes for LOGIN                    [hupcl,cread,echoe,>
  1123.   RUN shell activity manager                   no
  1124.   Optional LOGGER name                         []
  1125.  
  1126. 4. Change the hardware characteristics so that it uses NO XON/XOFF handshake
  1127.  
  1128. 5. Here is the the .profile for User slip to manage dialups
  1129.  
  1130. PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/local/bin:.
  1131.  
  1132. ENV=$HOME/.kshrc
  1133. HISTSIZE=128
  1134.  
  1135. export PATH ENV HISTSIZE
  1136. #
  1137. # Search for a LCK-File for our tty if there is one
  1138. #
  1139.  
  1140. if test -f /etc/locks/LCK..tty1
  1141. then
  1142.   SHPID=`cat /etc/locks/LCK..tty1`
  1143. else
  1144.  echo `date` " No LCK-File !!!" >>slip.log
  1145.  exit 64
  1146. fi
  1147.  
  1148. #
  1149. # Search for our own Shell to get the PID for checking against LCK-File
  1150. #
  1151.  
  1152. SH2PID=`ps -aef |
  1153.         sed -n -e 's/^ *slip  *\([0-9][0-9]*\) .*-sh *$/\1/p`
  1154.  
  1155. #
  1156. # Is it the the same PID as in the LCK File so that we can start working ??
  1157. #
  1158.  
  1159. if test $SHPID = $SH2PID
  1160. then
  1161. #  remove the LCK-File because slattach does not like it.
  1162.    rm -rf /etc/locks/LCK..tty1
  1163. #  Add RTS/CTS Handshakeing to our own tty
  1164.    stty add rts
  1165. #  Startup slattach. Slattach has to have mode 4755 to be started up !!!
  1166.    /usr/sbin/slattach tty1
  1167. #  Just say that we are up.
  1168.    echo `date` " Starting up slip-daemon " >>slip.log
  1169. #  leave slattach enough time to startup
  1170.    sleep 4
  1171. else
  1172. # Something must be wrong with the LCK-File
  1173.   SH3PID=`ps -aef | awk ' {print $2}' | grep $SHPID`
  1174.  
  1175.   if test ."$SH3PID" = .""
  1176.   then
  1177.     SH3PID="NO_SUCH_PROCESS"
  1178.   fi
  1179.  
  1180.   if test $SHPID = $SH3PID
  1181.     then
  1182. #  There is a living process which owns the LCK-File !!
  1183.        echo `date` " Can't remove LCK-File, not owner !!!" >>slip.log
  1184.        exit 64
  1185.     else
  1186. #   Who the hell didn't remove the LCK-File (should never happen)
  1187.        echo `date` " LCK-File with no owner found !!!" >>slip.log
  1188.        exit 64
  1189.     fi
  1190. fi
  1191.  
  1192. # Get the pid of slattch so that we can kill him later on.
  1193. SLPID=`ps -aef |
  1194.  sed -n -e 's/^ *slip  *\([0-9][0-9]*\) .*-.*\/usr\/sbin\/slattach tty1 *$/\1/p`
  1195.  
  1196. # Kill slattach if we get a signal 1 (Carrier Lost ? / Otherside-slattach
  1197.   terminated )
  1198. trap "kill $SLPID; exit 0" 1
  1199.  
  1200. # We  will have a nice sleep and nice dreamings
  1201. while sleep 256
  1202. do
  1203. :
  1204. done
  1205.  
  1206. Here's another scenario:
  1207. From: oosten@angelo.ee.ualberta.ca (Brian Oostenbrink)
  1208.  
  1209. Operating System: IBM AIX 3.2.1 and 3.2.3
  1210.  
  1211. Configuring two RS6000s via a Serial Line Interface Protocol (SLIP) 
  1212. connection over two US Robotics Sportster 14,400 modems.
  1213.  
  1214. The AIX implementation of SLIP is slightly different from most others. 
  1215. The ifconfig command is used to bring up a serial interface, and the
  1216. slattach command is used to connect the interface to the serial port
  1217. used for the connection.  Dialer device commands can also be issued when
  1218. invoking the slattach command, using UUCP chat syntax.
  1219.  
  1220. The following describes a connection between two machines:
  1221.  
  1222.      local.j.k.l
  1223.          ethernet IP address 129.128.127.21
  1224.          slip interface IP address 129.1.2.1
  1225.  
  1226.      remote.a.b.c
  1227.          ethernet IP address 129.11.22.44
  1228.          slip interface address 129.11.22.1
  1229.  
  1230. 1. Interface configuration
  1231.  
  1232. Each machine must have a separate IP address dedicated to the SLIP
  1233. interface. On remote.j.k.l, start the SLIP interface with:
  1234.  
  1235.          ifconfig sl0 129.11.22.1 129.128.127.1  up
  1236.  
  1237. and on local.a.b.c:
  1238.  
  1239.          ifconfig sl0 129.128.127.1 129.11.22.1  up
  1240.  
  1241. It is important in later versions of AIX 3.2.3+ to use the same SLIP
  1242. interface # as the ptty port #, ie. if you use tty12, use ifconfig sl12
  1243. instead of sl0.
  1244.  
  1245. At this point the interfaces are ready to be connected.
  1246.  
  1247. 2. tty configuration
  1248.    The tty ports on both machines were configured in an identical manner
  1249.    using smit.
  1250.                                                  [Entry Fields]
  1251.  TTY type                                           tty
  1252.  TTY interface                                      rs232
  1253.  Description                                        Asynchronous Terminal
  1254.  Parent adapter                                     sa0
  1255.  PORT number                                        []                       +
  1256.  BAUD rate                                          [38400]                  +
  1257.  PARITY                                             [none]                   +
  1258.  BITS per character                                 [8]                      +
  1259.  Number of STOP BITS                                [1]                      +
  1260.  TERMINAL type                                      [dumb]
  1261.  STATE to be configured at boot time                [available]              +
  1262.  DMA                                                on                       +
  1263.  Read Trigger                                       0,1,2,3
  1264.  Transmit buffer count                              [16]                      #
  1265.  Name of initial program to run                     [etc/getty]
  1266.  
  1267.  Note: The following attributes are only applicable if /etc/getty is specified
  1268.  as the initial program to run.
  1269.  
  1270.  Enable program?                                    respawn
  1271.  Run level                                          2
  1272.  Enable LOGIN                                       disable                  +
  1273.  TIME before advancing to next port setting         [0]                      +#
  1274.  STTY attributes for RUN TIME                       [hupcl,cread,brkint,icr>
  1275.  STTY attributes for LOGIN                          [hupcl,cread,echoe,cs8,>
  1276.  RUN shell activity manager                         no                       +
  1277.  Optional LOGGER name                               []
  1278.  
  1279. On older versions of AIX, we encountered some problems disabling getty, and
  1280. resorted to changing the /etc/inittab file directly. For example, change
  1281.  
  1282.    tty0:2:respawn:/etc/getty /dev/tty0
  1283. to
  1284.    tty0:2:off:/etc/getty /dev/tty0
  1285.  
  1286. This will disable getty from running. After creating the SLIP tty device,
  1287. you will need to change its hardware configuration to disable Xon/Xoff
  1288. flow control. Software flow control should not be used for SLIP. Type
  1289. 'smit chtty', and then select sub item 2: Hardware settings.
  1290.  
  1291. Most of the parameters in the tty configuration are the defaults.
  1292.  
  1293. 3. Modem Configuration
  1294.  
  1295.    The modems were configured as follows:
  1296.  
  1297.    RTS/CTS flow control enabled.
  1298.    Xon/Xoff software flow control disabled. Usually this is automatic if
  1299.       RTS/CTS is enabled.
  1300.    Data rate, terminal to modem = fixed.
  1301.       This is the baud rate from the tty port to the modem. We used a
  1302.       fixed modem-port transfer rate, set to the fastest speed supported
  1303.       by both the tty port and the modem. Newer modems can use a higher
  1304.       transfer rate between the modem and serial port than the modem to
  1305.       modem rate, which is necessary to use data compression effectively.  
  1306.       In our setup, we used 14.4 kBaud modems with a port speed of 38.4
  1307.       kBaud. If your modem supports this feature, use it, otherwise set
  1308.       the port speed equal to the modem connection rate. On the USR
  1309.       Sportster at&b1 fixes the serial port rate to that of the last
  1310.       AT command. The speed parameter of the slattach command can be
  1311.       used to ensure that this rate is that set in the tty configuration.
  1312.    Error Correction enabled - not mandatory, but a good idea
  1313.    Data Compression - not required, but it helps, especially for text
  1314.       transfers.
  1315.    Auto Answer - If the SLIP connection is to be initiated from either
  1316.       machine, both modems should be set to auto answer, otherwise, just
  1317.       the answering modem.
  1318.  
  1319.    It is a good idea to configure the modem and then save the settings
  1320.    to NVRAM, so that the correct settings can always be restored by the
  1321.    slattach command.
  1322.  
  1323. 4. UUCP configuration files
  1324.  
  1325.    /usr/lib/uucp/Devices
  1326.    /usr/lib/uucp/Dialers
  1327.  
  1328.    The Devices file must contain an entry with the tty and serial port
  1329.    speed used for the interface. In our example,
  1330.       Direct tty0 38400 slipdialer
  1331.  
  1332.    The keyword 'slipdialer' is merely an index into the Dialers file.
  1333.    For our purposes, the slipdialer entry in the Dialers file is simply:
  1334.  
  1335.       slipdialer
  1336.  
  1337.    This entry can also contain UUCP chat commands, or the chat commands
  1338.    can be included in the slattach command.
  1339.  
  1340. 5. slattach invocation
  1341.  
  1342.    slattach connects the device on the tty port to the SLIP interface
  1343.    created by ifconfig, and sends any commands to the tty device if
  1344.    needed. For our example, remote.j.k.l would never initiate a call,
  1345.    only answer incoming calls. Therefore we execute:
  1346.  
  1347.          slattach tty0 38400 '"" ATZ OK ""'
  1348.  
  1349.    which connects the tty at 38400 baud. We could also simply run
  1350.  
  1351.          slattach tty0
  1352.  
  1353.    ie. without any modem commands, but the modem to port speed may not
  1354.    be correctly set this way. In addition, the ATZ command ensures the
  1355.    modem is set to the NVRAM settings.
  1356.  
  1357.    On local.a.b.c type:
  1358.  
  1359.          slattach tty0 38400 '"" ATZ OK \pATDT4925871 BIS ""' 4
  1360.  
  1361.    This establishes the link at 38400 baud, and executes the dial string
  1362.    as shown. The dial string is a UUCP chat string and are configured
  1363.    in an expect send expect send ... format. The string:
  1364.  
  1365.          '"" ATZ OK \pATDT4925871 BIS ""'
  1366.  
  1367.    is interpreted as:
  1368.    expect "" (null string) from modem
  1369.    send   ATZ              to modem
  1370.    expect OK               from modem
  1371.    send   \pATDT4925871    to modem
  1372.    expect BIS              from modem
  1373.  
  1374.    BIS is the end of the CONNECT STRING. You could use any portion of
  1375.    the string returned by the modem upon a connection as the expect
  1376.    string. It may be wiser to simply expect CONNECT since all
  1377.    connections should return this string.
  1378.    The null strings are necessary because the first parameter of the
  1379.    UUCP is an expected string from the modem, which can only be a null
  1380.    string until the modem has been given a command.
  1381.  
  1382.    The last parameter (4) of the slattach command is the debug level. 
  1383.    A debug level of 4 displays the UUCP chat strings, which is useful
  1384.    for checking the modem status.
  1385.  
  1386. 6. Routing
  1387.    Routing through the SLIP link is similiar to routing of any gateway. 
  1388.    Invoking the ifconfig command automatically sets up a route between
  1389.    the two SLIP machines. An entry in /etc/hosts or the named database
  1390.    should be made, with the same machine name used for the SLIP address
  1391.    as the ethernet address on each machine. For example, in /etc/hosts
  1392.    on remote.a.b.c (and any other machine on remote.a.b.c ethernet):
  1393.  
  1394.      129.11.22.44 remote.a.b.c # ethernet address
  1395.      129.11.22.1  remote.a.b.c # slip address
  1396.  
  1397.    It is preferable to place the ethernet address in the hosts file
  1398.    before the SLIP address so remote.a.b.c will resolve to the
  1399.    ethernet address. When using named, it is important to have both
  1400.    addresses in the reverse file with the same name. We experienced
  1401.    difficulties with NFS mounting over the slip link, owing to some
  1402.    machine interpreting NFS requests from one of the two SLIP machines
  1403.    as coming from the SLIP address, while the SLIP machine believed it
  1404.    was sending the request from the ethernet address. This problem was
  1405.    eliminated by having both addresses reverse resolve to the same name.
  1406.  
  1407. 7. Performance
  1408.    At a modem speed of 14.4 kBaud and a port speed of 38.4 kBaud, we
  1409.    realized a transfer rate through ftp of about 3.5 kB/s for text
  1410.    files, and 1.3 kB/s for compressed files.
  1411.  
  1412.  
  1413. 1.607: Where is DCE discussed?
  1414. From: brent@uwovax.uwo.ca (Brent Sterner)
  1415.  
  1416. DCE is the Distributed Computing Environment, which is roughly a
  1417. flexible client-server architecture for heterogenous platforms.
  1418. For more information, take a look in comp.unix.osf.misc. 
  1419.  
  1420.  
  1421. 1.608: How do I make /var/spool/mail mountable?
  1422. From: petersen@pi1.physik.uni-stuttgart.de (Joerg Petersen)
  1423.  
  1424. In our cluster we share a /usr/local disk. We have a directory
  1425. /usr/local/spool/mail and /var/spool/mail is soft-linked to it.
  1426.  
  1427. From: fred@hal6000.thp.Uni-Duisburg.DE (Fred Hucht)
  1428.  
  1429. Several problems has been reported on sharing the mail directory via
  1430. NFS. The problems may occur when two or more sendmail daemons and/or
  1431. mail readers access a user's mail file simultanously, because of NFS'
  1432. file locking mechanism.
  1433.  
  1434. We use another method here: Every user has one line in his/her
  1435. $HOME/.forward file that reads
  1436.  
  1437. xxx@mainserver.domain.name
  1438.  
  1439. where xxx is the user node and mainserver.domain.name is the full
  1440. hostname of one of the machines. Then all incoming mail to all machines
  1441. is forwarded to mainserver, while mainserver ignores this line.
  1442.  
  1443. ______________________________________________________________________________
  1444. 1.900: SCSI-1 and SCSI-2 "interoperability" got you confused?
  1445. From: drr
  1446.  
  1447. A.  SCSI-1 devices are supported on a SCSI-2 adapter.  This
  1448.     config will provide SCSI-1 performance.
  1449.  
  1450. B.  SCSI-2 devices are supported on a SCSI-1 adapter.  This
  1451.     config will provide SCSI-1 performance.
  1452.  
  1453. C.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
  1454.     adapter.  All devices will have SCSI-1 performance.
  1455.  
  1456. D.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
  1457.     adapter.  SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
  1458.     and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).
  1459.  
  1460.  
  1461. 1.901: How to get your keyboard back after unplugging it from the 6000
  1462. From: Mickey Coggins and Anne Serre
  1463.  
  1464. When you unplug your keyboard from a running system, and plug it back
  1465. in, the key mapping is wrong.  For example, keys like Caps Lock and Ctrl
  1466. don't work as designed.
  1467.  
  1468. Solution: Type at the command line
  1469.  
  1470.         /usr/lpp/diagnostics/da/dkbd
  1471.  
  1472. Your screen goes black, you hear a few beeps, and your keyboard is reset.
  1473. It works with any environment, Xwindows, hft, NLS...
  1474.  
  1475. For Models 220, 230 and M20, use the following commands:
  1476.  
  1477. /usr/lpp/diagnostics/da/dkbd
  1478. /usr/lpp/diagnostics/da/dkbdsal   (for the 220)
  1479.  
  1480.  
  1481. 1.902: How do I set up pcsim, the DOS emulator?
  1482.  
  1483. You must have a bootable DOS diskette to install pcsim. Either DOS 3.3, 
  1484. 4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
  1485. but I have no problems with it. Just don't try to be fancy with the UMB 
  1486. and memory manager stuff.
  1487.  
  1488. With a bootable DOS disk in the drive, do:
  1489. $touch /u/dosdrive (this is the AIX file for DOS emulation)
  1490. $pcsim -Adiskette 3 -Cdrive /u/dosdrive
  1491. You would now get an A prompt. Type:
  1492. A> fdisk
  1493. Create the virtual C drive of whatever size you choose. Make it large 
  1494. enough for your needs since you cannot enlarge it later.
  1495. A> format c: /s (to format the virtual C drive)
  1496. Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).
  1497.  
  1498. Now create a simprof file. Following is a starter:
  1499.  
  1500. Adiskette   : 3
  1501. Cdrive      :/u/dosdrive
  1502. lpt1        : name of printer queue
  1503. refresh     : 50
  1504. dmode       : V
  1505. mouse       : com1
  1506.  
  1507. You can now start pcsim anytime by typing pcsim. Make sure no floppies
  1508. are in the drive. For further information, refer to publication
  1509. SC23-2452, Personal Computer Simulator/6000 Guide and Reference.
  1510.        
  1511.  
  1512. 1.903: How do I transfer files between AIX and DOS disks?
  1513.  
  1514. In one of the bos extensions are commands for transferring files between
  1515. DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
  1516. and dosformat. Many users have mentioned that the mtools package from
  1517. prep.ai.mit.edu is better than the native AIX programs.
  1518.  
  1519. _____________________________________________________________________________
  1520. 2.00: C/C++
  1521.  
  1522. Contrary to many people's belief, the C environment on the RS/6000 is
  1523. not very special.  The C compiler has quite a number of options that can
  1524. be used to control how it works, which "dialect" of C it compiles, how
  1525. it interprets certain language constructs, etc.  InfoExplorer includes a
  1526. Users Guide and a Reference Manual.
  1527.  
  1528. The compiler can be invoked with either xlc for strict ANSI mode and cc
  1529. for RT compatible mode (i.e. IBM 6150 with AIX 2).  The default options
  1530. for each mode are set in the /etc/xlc.cfg file, and you can actually add
  1531. another stanza and create a link to the /bin/xlc executable.
  1532.  
  1533. The file /usr/lpp/xlc/bin/README.xlc has information about the C
  1534. compiler, and the file /usr/lpp/bos/bsdport contains useful information,
  1535. in particular for users from a BSD background.
  1536.  
  1537. The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
  1538. and therefore can be used for #ifdef'ing RS/6000 specific code.
  1539.  
  1540.  
  1541. 2.01: I cannot make alloca work
  1542.  
  1543. A famous routine, in particular in GNU context, is the allocation
  1544. routine alloca().  Alloca allocates memory in such a way that it is
  1545. automatically free'd when the block is exited.  Most implementations
  1546. does this by adjusting the stack pointer.  Since not all C environments
  1547. can support it, its use is discouraged, but it is included in the xlc
  1548. compiler.  In order to make the compiler aware that you intend to use
  1549. alloca, you must put the line
  1550.  
  1551. #pragma alloca
  1552.  
  1553. before any other statements in the C source module(s) where alloca is
  1554. called.  If you don't do this, xlc will not recognize alloca as anything
  1555. special, and you will get errors during linking.
  1556.  
  1557. For AIX 3.2, it may be easier to use the -ma flag.
  1558.  
  1559.  
  1560. 2.02: How do I compile my BSD programs?
  1561.  
  1562. The file /usr/lpp/bos/bsdport contains information on how to port
  1563. programs written for BSD to AIX 3.1.  This file may be very useful for
  1564. others as well.
  1565.  
  1566. A quick cc command for most "standard" BSD programs is:
  1567.   
  1568.   $ cc -D_BSD -D_BSD_INCLUDES  -o [loadfile] [sourcefile.c] -lbsd
  1569.  
  1570. If your software has system calls predefined with no prototype
  1571. parameters, also use the -D_NO_PROTO flag.
  1572.  
  1573.  
  1574. 2.03: Isn't the linker different from what I am used to?
  1575.  
  1576. Yes.  It is not at all like what you are used to:
  1577.  
  1578. - The order of objects and libraries is normally _not_ important.  The
  1579.   linker reads _all_ objects including those from libraries into memory
  1580.   and does the actual linking in one go.  Even if you need to put a
  1581.   library of your own twice on the ld command line on other systems, it
  1582.   is not needed on the RS/6000 - doing so will even make your linking slower.
  1583.  
  1584. - One of the features of the linker is that it will replace an object in
  1585.   an executable with a new version of the same object:
  1586.  
  1587.   $ cc -o prog prog1.o prog2.o prog3.o        # make prog
  1588.   $ cc -c prog2.c                # recompile prog2.c
  1589.   $ cc -o prog.new prog2.o prog            # make prog.new from prog
  1590.                         # by replacing prog2.o
  1591.   
  1592. - The standard C library /lib/libc.a is linked shared, which means that
  1593.   the actual code is not linked into your program, but is loaded only
  1594.   once and linked dynamically during loading of your program.
  1595.  
  1596. - The ld program actually calls the binder in /usr/lib/bind, and you can
  1597.   give ld special options to get details about the invocation of the
  1598.   binder.  These are found on the ld man page or in InfoExplorer.
  1599.  
  1600. - If your program normally links using a number of libraries (.a files),
  1601.   you can 'prelink' each of these into an object, which will make your
  1602.   final linking faster.  E.g. do:
  1603.  
  1604.   $ cc -c prog1.c prog2.c prog3.c
  1605.   $ ar cv libprog.a prog1.o prog2.o prog3.o
  1606.   $ ld -r -o libprog.o libprog.a
  1607.   $ cc -o someprog someprog.c libprog.o
  1608.  
  1609. This will solve all internal references between prog1.o, prog2.o and
  1610. prog3.o and save this in libprog.o Then using libprog.o to link your
  1611. program instead of libprog.a will increase linking speed, and even if
  1612. someprog.c only uses, say prog1.o and prog2.o, only those two modules
  1613. will be in your final program.  This is also due to the fact that the
  1614. binder can handle single objects inside one object module as noted above.
  1615.  
  1616. If you are using an -lprog option (for libprog.a) above, and still want
  1617. to be able to do so, you should name the prelinked object with a
  1618. standard library name, e.g. libprogP.a (P identifying a prelinked
  1619. object), that can be specified by -lprogP.  You cannot use the archiver
  1620. (ar) on such an object.
  1621.  
  1622. You should also have a look at section 3.01 of this article, in
  1623. particular if you have mixed Fortran/C programs.
  1624.  
  1625. Dave Dennerline (dad@adonis.az05.bull.com) claims that his experiences
  1626. in prelinking on AIX does not save much time since most people have
  1627. separate libraries which do not have many dependencies between them,
  1628. thus not many symbols to resolve.
  1629.  
  1630.  
  1631.